package cn.tedu.cs.baking.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

@Data
public class PictureDTO {
    /**
     * 验证请求参数失败的描述文本前缀
     */
    private static final String VALIDATE_MESSAGE_PREFIX = "新增图片信息失败，";

    private Long id;

    /**
     * 相册ID
     */
    @ApiModelProperty(value = "图片所属相册id", required = true, dataType = "long")
    @NotNull(message = VALIDATE_MESSAGE_PREFIX + "请选择所属相册！")
    @Min(value = 0, message = VALIDATE_MESSAGE_PREFIX + "选择的所属相册的数据格式错误！")
    private Long albumId;

    /**
     * 图片路径
     */
    @ApiModelProperty(value = "图片URL", required = true)
    @NotNull(message = VALIDATE_MESSAGE_PREFIX + "请填写URL！")
    private String url;

    /**
     * 图片描述
     */
    @ApiModelProperty(value = "简介", required = true)
    @NotNull(message = VALIDATE_MESSAGE_PREFIX + "请填写简介！")
    private String description;

    /**
     * 原始文件名
     */
    @ApiModelProperty(value = "原始文件名", required = true)
    @NotNull(message = VALIDATE_MESSAGE_PREFIX + "请填写原始文件名！")
    private String oldName;

    /**
     * 系统文件名
     */
    @ApiModelProperty(value = "系统文件名", required = true)
    @NotNull(message = VALIDATE_MESSAGE_PREFIX + "请填写系统文件名！")
    private String sysName;

    /**
     * 类型
     */
    @ApiModelProperty(value = "类型", required = true)
    @NotNull(message = VALIDATE_MESSAGE_PREFIX + "请填写类型！")
    private String type;
}
